home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / active_partition / 80resize / do_option < prev   
Encoding:
Text File  |  2009-04-19  |  1.0 KB  |  55 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/resize.sh
  4.  
  5. dev=$2
  6. oldid=$3
  7.  
  8. cd $dev
  9.  
  10. check_virtual
  11.  
  12. if [ "$virtual" = no ] && [ -f $oldid/detected_filesystem ]; then
  13.     case "$(cat $oldid/detected_filesystem)" in
  14.         ntfs)
  15.         if ! get_ntfs_resize_range; then
  16.             db_input critical partman-partitioning/impossible_resize || true
  17.             db_go || true
  18.             exit 1
  19.         fi
  20.         ;;
  21.         ext2|ext3|ext4)
  22.         if ! get_ext2_resize_range; then
  23.             db_input critical partman-partitioning/impossible_resize || true
  24.             db_go || true
  25.             exit 1
  26.         fi
  27.         ;;
  28.         *)
  29.         get_resize_range
  30.         ;;
  31.     esac
  32. else
  33.     get_resize_range
  34. fi
  35.  
  36. if [ -z "$maxsize" ]; then
  37.     logger -t partman "Error: unable to determine maximum new size for partition"
  38.     db_input critical partman-partitioning/impossible_resize || true
  39.     db_go || true
  40.     exit 1
  41. fi
  42.  
  43. human_resize_range
  44.  
  45. if [ "$virtual" = no ]; then
  46.     db_set partman-partitioning/confirm_resize false
  47.     db_input critical partman-partitioning/confirm_resize || true
  48.     db_go || exit 0
  49.     db_get partman-partitioning/confirm_resize
  50.     [ "$RET" = true ] || exit 0
  51. fi
  52.  
  53. ask_for_size || exit $?
  54. exit 100
  55.